//
//  CJSplashAd.h
//  CJMobileAd
//
//  Created by JJ on 2022/2/22.
//  Copyright © 2022 JJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class CJSplashAd;
@protocol CJSplashAdDelegate <NSObject>

- (void)splashAdDidLoad:(CJSplashAd *)splashAd resourceId:(NSString *)resourceId;

- (void)splashAdLoadFailed:(CJSplashAd *)splashAd error:(NSError *)error;

- (void)splashAdOnClicked:(CJSplashAd *)splashAd;

- (void)splashAdOnClosed:(CJSplashAd *)splashAd;

@end

@interface CJSplashAd : NSObject

@property (nonatomic, weak) id <CJSplashAdDelegate> delegate;

- (instancetype)initWithResourceId:(NSString *)resourceId
                            window:(UIWindow *)window
                rootViewController:(UIViewController *)rootViewController
                    customLogoView:(UIView *)logoView;

- (void)loadAdData;

- (void)showSplashAdToWindow:(UIWindow *)window;

@end



NS_ASSUME_NONNULL_END
